1. Technical Field
The present invention relates to an image processing device and an image processing method for performing pattern matching process and the like.
2. Related Art
Conventionally, in a field of FA (Factory Automation) and the like, pattern matching process based on a standard pattern (hereinafter also referred to as “model image”) registered in advance is used on an input image obtained by imaging a target (hereinafter also referred to as “target work”). Defects such as scratches and dust that appear on the target work can be detected, and a portion on the target work similar to the model image can be searched through the pattern matching process.
In such a pattern matching process, a window needs to be set in the input image obtained by imaging the target work, and a partial image (image information) in the window and the model image registered in advance need to be compared. The image information of each pixel (typically, gray value of 8 bits) is sequentially outputted from the imaging device along a predetermined scanning direction. In other words, the image information of the pixels contained in the set window is outputted not at the same timing, but in time-series with a delay time.
Thus, a buffer memory of a predetermined amount (typically, worth one screen) is prepared, and the image information from the imaging device is sequentially stored in the buffer memory and the pattern matching process is executed on the stored image information to resolve such a temporal shift. The image processing device for performing the pattern matching process thus has problems in that the circuit configuration enlarges and becomes complicating.
With respect to such a problem, International Publication No. WO93/18471 pamphlet discloses an image processing device, and the like capable of miniaturizing the hardware. In such an image processing device, the input image data represented by a first predetermined number of bits per one pixel is stored in a line memory after being converted to pseudo-halftone image data represented by a second predetermined number of bits less than the first predetermined number of bits. The hardware thus can be miniaturized.
As a new method of the pattern matching process, extracting a portion where change in gray value (brightness) is found in the input image (hereinafter also referred to as “edge (portion)”, and performing pattern matching based on a value indicating the changing direction of the edge (hereinafter also referred to as “edge code” or “EC (Edge Code)”) is disclosed (e.g., Japanese Unexamined Patent Publication No. 2002-230549). The portion similar to the model image then can be accurately searched by using the edge code even if influence at the time of imaging of the input image is present (e.g., appearing of shade and illumination variation).
The image processing device disclosed in International Publication No. WO93/18471 pamphlet is configured to perform the pattern matching process based on the gray value of the input image, and is not to perform the pattern matching based on the edge code. The circuit configuration thus enlarges and becomes complicating when performing the pattern matching based on the edge code. The processing time also becomes long compared to the hardware when implemented with the software process using a processor.